from  tkinter import *
import math
ox = 400
oy = 500
max_x = 800 
max_y = 600 
scale_x = 80
scale_y = 60
start = -5.0
end =5.0 
delta = 0.01

tk = Tk()
canvas = Canvas(tk,width=max_x,height=max_y,bd=0)
canvas.pack()

def draw_point (x,y,r =1, c="black"):
    canvas.create_oval(x-r,y-r,x+r,y+r,fill=c,outline=c)

def draw_axes(ox,oy,width,height):
    canvas.create_line(0,oy,width,oy)
    canvas.create_line(ox,0,ox,height)

def f(x):
    return x*x

def plot(x,y):
    draw_point(scale_x*x+ ox,oy-scale_y*y)

draw_axes(ox,oy,max_x,max_y)

x = start

while x < end:
    print(x,f(x))
    plot(x,f(x))
    x = x+ delta


tk.mainloop()
    
